home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK2.toast / Development Kits (Disc 2) / ScriptX / Documentation / Code Examples from Docs / compguid / transitn / transitn.sx
Encoding:
Text File  |  1996-05-21  |  1.2 KB  |  47 lines  |  [TEXT/ttxt]

  1. --<<<
  2. -- Filename: TRANSITN.SX
  3.  
  4. -- Other Files Required: (none)
  5.  
  6. -- Purpose: To demonstrate how transitions work
  7.  
  8. -- Specialized Classes: (none)
  9.  
  10. -- Instructions to User: Load this file; first it displays a red square.
  11. --     Watch the white oval appear, wiping into view from left to right
  12.  
  13. -- Author: Douglas Kramer
  14.  
  15. ------------------------------------------------------------------------
  16.  
  17. -- Set up a window
  18. global myWindow := new Window boundary:(new Rect x2:400 y2:400)
  19. myWindow.y := 40
  20. show myWindow
  21.  
  22. -- Create a red rectangle
  23. global redBrush := new Brush color:redColor pattern:blackPattern
  24. global myRect := new TwoDShape target:(new Rect x2:300 y2:300) fill:redBrush
  25.     myRect.x := 50
  26.     myRect.y := 50
  27. append myWindow myRect 
  28.  
  29. -- Create a white circle
  30. global myOval := new TwoDShape target:(new Oval x2:200 y2:200) \
  31.     fill:whiteBrush stroke:blackBrush
  32.     myOval.x := 100
  33.     myOval.y := 100
  34.  
  35. -- Make the transition
  36. global myWipe := new Wipe duration:30 direction:@right target:myOval \
  37.     scale:30  useOffscreen:true
  38. myWipe.backgroundBrush := redBrush
  39. prepend myWindow myWipe
  40.  
  41. -- Prepare to play, which creates the cached target
  42. playPrepare myWipe 1
  43.  
  44. play myWipe 
  45.  
  46. --To play again, type: goToBegin myWipe
  47.